% 非常简单的显式Euler法求解ODE
%Gitee Repo

clc
clear

dx = 0.01;
x0 = 0;
y0 = 0;

f = @(x,y) -(x-1)/y;

y(1)=sqrt(8);
x(1)=0;

for i = 1:400
  y(i+1) = y(i) + f(x(i), y(i))*dx;
  x(i+1) = x(i) + dx;
end

figure()
hold on
axis equal

plot(x,y);

